package android.Controle;

import java.util.HashMap;

import android.FiltrosJava.ColorReduction16;
import android.FiltrosJava.ColorReduction32;
import android.FiltrosJava.ColorReduction64;
import android.FiltrosJava.ColorReplace18;
import android.FiltrosJava.ColorReplace27;
import android.FiltrosJava.ColorReplace48;
import android.FiltrosJava.ColorReplace60;
import android.FiltrosJava.ContrastFilter;
import android.FiltrosJava.Dissolve;
import android.FiltrosJava.DitherFilter;
import android.FiltrosJava.Filtro;
import android.FiltrosJava.GrayscaleFilter;
import android.FiltrosJava.LuminosityCorrection;
import android.FiltrosJava.MinusBrightFilter;
import android.FiltrosJava.MirrorHorizontal;
import android.FiltrosJava.MirrorVertical;
import android.FiltrosJava.MoreBrightFilter;
import android.FiltrosJava.NegativeFilter;
import android.FiltrosJava.Posterize;
import android.FiltrosJava.Rotate180;
import android.FiltrosJava.SaturationCorrection;
import android.FiltrosJava.ScanLine;
import android.FiltrosJava.Solarize;
import android.FiltrosJava.UniformNoise;
import android.FiltrosJava.Vanish;

public class FiltersCommand {
	public static HashMap<String,Filtro> selectFilter= new HashMap<String, Filtro>();

	public static void preencheHash() {
		//selectFilter.put("MirrorVertical", new MirrorVertical());
		//selectFilter.put("MirrorHorizontal", new MirrorHorizontal());
		selectFilter.put("MoreBrightFilter", new MoreBrightFilter());
		selectFilter.put("MinusBrightFilter", new MinusBrightFilter());
		selectFilter.put("GrayscaleFilter", new GrayscaleFilter());
		selectFilter.put("Posterize", new Posterize());
		selectFilter.put("ScanLine", new ScanLine());
		selectFilter.put("NegativeFilter", new NegativeFilter());
		selectFilter.put("ColorReduction16", new ColorReduction16());
		selectFilter.put("ColorReduction32", new ColorReduction32());
		selectFilter.put("ColorReduction64", new ColorReduction64());
		selectFilter.put("ColorReplace18", new ColorReplace18());
		selectFilter.put("ColorReplace27", new ColorReplace27());
		selectFilter.put("ColorReplace48", new ColorReplace48());
		selectFilter.put("ColorReplace60", new ColorReplace60());
		selectFilter.put("MenosContrastFilter", new ContrastFilter(-10));
		selectFilter.put("MaisContrastFilter", new ContrastFilter(10));
		selectFilter.put("Dissolve", new Dissolve(10));
		selectFilter.put("DitherFilter", new DitherFilter());
		selectFilter.put("LuminosityCorrection", new LuminosityCorrection(2));
		selectFilter.put("SaturationCorrection", new SaturationCorrection(2));
		selectFilter.put("Solarize", new Solarize());
		selectFilter.put("UniformNoise", new UniformNoise(0.1f));
		selectFilter.put("VanishBranco", new Vanish(255, 255, 255, 0.75f));
		selectFilter.put("VanishPreto", new Vanish(0, 0, 0, 0.75f));
		selectFilter.put("MirrorHorizontal", new MirrorHorizontal());
		selectFilter.put("MirrorVertical", new MirrorVertical());
		selectFilter.put("Rotate180", new Rotate180());
	}
	
	public static Filtro InstanciaFilter(String filterName){
		if(selectFilter.containsKey(filterName)){
		System.out.println("namePassado: + "+filterName+", nameFitro: "+selectFilter.get(filterName));
		return selectFilter.get(filterName);
		}
		return null;
	}	
}
